<!DOCTYPE html>
<!--[if IE 9]>         <html class="no-js lt-ie10" lang="en"> <![endif]-->
<!--[if gt IE 9]><!-->
<html class="no-js" lang="en"> <!--<![endif]-->
<head>
    <meta charset="utf-8">

    <title>数字币对冲平台|BDS虚拟币对冲平台</title>
 		<#include "../static/top.ftl" >

</head>
<body>
<!-- Page Wrapper -->
<!-- In the PHP version you can set the following options from inc/config file -->
<!--
    Available classes:

    'page-loading'      enables page preloader
-->
<div id="page-wrapper" class="page-loading">
    <!-- Preloader -->
    <!-- Preloader functionality (initialized in js/app.js) - pageLoading() -->
    <!-- Used only if page preloader enabled from inc/config (PHP version) or the class 'page-loading' is added in #page-wrapper element (HTML version) -->
    <div class="preloader">
        <div class="inner">
            <!-- Animation spinner for all modern browsers -->
            <div class="preloader-spinner themed-background hidden-lt-ie10"></div>

            <!-- Text for IE9 -->
            <h3 class="text-primary visible-lt-ie10"><strong>Loading..</strong></h3>
        </div>
    </div>

    <div id="page-container" class="header-fixed-top sidebar-visible-lg-full sidebar-light">
        <!-- Alternative Sidebar -->

        <!-- END Alternative Sidebar -->

        <!-- Main Sidebar -->



                <#include "../static/menu.ftl" >

        <!-- END Main Sidebar -->

        <!-- Main Container -->
        <div id="main-container">
            <!-- Header -->



           <#include "../static/header.ftl" >
            <!-- END Header -->

            <!-- Page content -->
            <div id="page-content">
                <!-- Validation Header -->
                <div class="content-header">
                    <div class="row">
                        <div class="col-sm-6">
                            <div class="header-section">
                                <h1>交易记录</h1>
                            </div>
                        </div>
                        <div class="col-sm-6 hidden-xs">
                            <div class="header-section">
                                <ul class="breadcrumb breadcrumb-top">
                                    <li>User Interface</li>
                                    <li>Forms</li>
                                    <li><a href="">Validation</a></li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="row">
                    <div class="block full">

                        <div class="tab-pane">
                            <table class="table table-striped">
                                <thead>
                                <tr>
                                    <th>交易所</th>
                                    <th>交易币对</th>
                                    <th>数量</th>
                                    <th>单价</th>
                                    <th>类型</th>
                                    <th>状态</th>
                                    <th>创建时间</th>
                                </tr>
                                </thead>
                                <tbody id="trade_record">
                                </tbody>
                            </table>
                        </div>
                        <button type="button" id="refresh_record" class="btn btn-effect-ripple btn-primary" style="float: right; overflow: hidden; position: relative;">刷新</button>
                    </div>
                </div>
                <!-- END Page Wrapper -->

                <script>
                    var infos=new Map();

                    $(function () {
                        infos.set(0,"下单失败");
                        infos.set(1,"挂单中");
                        infos.set(2,"交易完成");
                        infos.set(3,"订单撤销");
                        infos.set(4,"部分成交");
                        initRecord();
                    });



                    function initRecord() {
                      <#list list as l>
                      $("#trade_record").append("<tr><td>${l.exchange}</td><td>${l.symbol}</td><td>${l.num}</td>"
                          +"<td>${l.price}</td><td>${l.type}</td><td>"+infos.get(${l.status})+"</td><td>${l.create_time?datetime}</td>");
                      </#list>
                    }

                    $("#refresh_record").click(function () {
                        $.get("/spot/record/refresh",function (data) {
                            if (data.code==200){
                                alert(data.msg);
                                location.reload();
                            }else{
                                alert(data.msg);
                            }
                        });

                    });
                </script>
</body>
</html>